<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:br="http://bree.owenrb.com/functions">
<body>
	<ui:composition>
	
		<p:dataTable var="balance" value="#{dtReserveBalanceLazyView.lazyModel}"
			paginator="true" rows="10"
			paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}"
			rowsPerPageTemplate="5,10,15" selectionMode="single"
			selection="#{dtReserveBalanceLazyView.selectedItem}" lazy="true">
			
			<p:ajax event="rowSelect"
				listener="#{dtReserveBalanceLazyView.onRowSelect}"
				update="#{ajaxEventUpdate}" oncomplete="#{ajaxEventOnComplete}" />
				
			<p:column headerText="Warehouse" sortBy="#{balance.warehouse.id}" filterBy="#{balance.warehouse.id}">
				<h:outputText value="#{balance.warehouse.id}" />
			</p:column>
			<p:column headerText="Description" sortBy="#{balance.partUnit.shortName}" filterBy="#{balance.partUnit.shortName}">
				<h:outputText value="#{balance.partUnit.shortName}" />
			</p:column>
			<p:column headerText="Brand" sortBy="#{balance.partUnit.shortBrand}" filterBy="#{balance.partUnit.shortBrand}">
				<h:outputText value="#{balance.partUnit.shortBrand}" />
			</p:column>
			<p:column headerText="Unit" sortBy="#{balance.partUnit.shortUnit}" filterBy="#{balance.partUnit.shortUnit}">
				<h:outputText value="#{balance.partUnit.shortUnit}" />
			</p:column>
			<p:column headerText="Part#" sortBy="#{balance.partUnit.part}" filterBy="#{balance.partUnit.part}">
				<h:outputText value="#{balance.partUnit.part}" />
			</p:column>
			<p:column headerText="Available Balance">
				<h:outputText value="#{balance.totalBalance - br:nvl(quantityMap[balance.warehousePartUnitId],0)}" />
			</p:column>
		</p:dataTable>

	</ui:composition>
</body>
</html>